﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogic;
using JScripter;
using BusinessLogic.Helper;

public partial class AjaxPages_User_Login : AjaxPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Login_Click(object sender, AjaxControl.AjaxEventArg e)
    {
        string email = HtmlHelper.ControlValue(txtEmail.ClientID);
        string password = HtmlHelper.ControlValue(txtPassword.ClientID);
        if (LoginHelper.ValidateUser(email, password))
        {
            JScripter.Loader.RedirectPage(ResolveUrl("~/Default.aspx"), this);
        }
        else
        {
            divMessage.InnerHtml = "Invalid Email or password";
        }
    }
}